<template>
<van-share-sheet
  :show="showShare"
  title="立即分享给好友"
  :options="options"
  @select="onSelectManager"
  @close="onCloseManager"
/>

</template>

<script>
	export default {
		components: {},
		data() {
			return {
				showShare:false,
				 options: [
				        { name: '微信', icon: 'wechat',openType:'share' },
				      ],
					  path:'',
			}
		},
		props: {
		
		},

		methods: {
			open(path){
				this.path = path;
				this.showShare = true;
			},
			close(){
				this.showShare = false;
			},
			onSelectManager(event){
				var name = event.detail.name;
				
				if (name === '微信'){
					uni.share({
					    provider: 'weixin',
					    scene: "WXSceneSession",
					    type: 5,
					    imageUrl: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/share-logo@3.png',
					    title: '欢迎体验uniapp',
					    miniProgram: {
					        id: 'gh_874036481283',
					        path: this.path,
					        type: 0,
					        webUrl: 'http://uniapp.dcloud.io'
					    },
					    success: ret => {
					        console.log(JSON.stringify(ret));
					    }
					});
				}
			},
			
			onCloseManager(){
				this.showShare = false;
			}
			
			

		}
	}
</script>

<style lang='scss' scoped>

</style>